package receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class StandardReceiver extends BroadcastReceiver {
    public final static String STANDARD_ACTION = "com.example.a514.standard";
    // 一旦收到广播就会触发接收器的Receive方法
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent != null && intent.getAction().equals(STANDARD_ACTION)){
            Toast.makeText(context,"收到广播",Toast.LENGTH_LONG).show();
        }
    }
}
